﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.BoneWeight1
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using UnityEngine.Scripting;

#nullable disable
namespace UnityEngine
{
  /// <summary>
  ///   <para>Describes a bone weight that affects a vertex in a mesh.</para>
  /// </summary>
  [UsedByNativeCode]
  [Serializable]
  public struct BoneWeight1 : IEquatable<BoneWeight1>
  {
    [SerializeField]
    private float m_Weight;
    [SerializeField]
    private int m_BoneIndex;

    /// <summary>
    ///   <para>Skinning weight for bone.</para>
    /// </summary>
    public float weight
    {
      get => this.m_Weight;
      set => this.m_Weight = value;
    }

    /// <summary>
    ///   <para>Index of bone.</para>
    /// </summary>
    public int boneIndex
    {
      get => this.m_BoneIndex;
      set => this.m_BoneIndex = value;
    }

    public override bool Equals(object other) => other is BoneWeight1 other1 && this.Equals(other1);

    public bool Equals(BoneWeight1 other)
    {
      return this.boneIndex.Equals(other.boneIndex) && this.weight.Equals(other.weight);
    }

    public override int GetHashCode() => this.boneIndex.GetHashCode() ^ this.weight.GetHashCode();

    public static bool operator ==(BoneWeight1 lhs, BoneWeight1 rhs)
    {
      return lhs.boneIndex == rhs.boneIndex && (double) lhs.weight == (double) rhs.weight;
    }

    public static bool operator !=(BoneWeight1 lhs, BoneWeight1 rhs) => !(lhs == rhs);
  }
}
